<!DOCTYPE HTML>
<html lang="zh">
<head>
    {include file="public/meta"}
    <title>权限菜单</title>
    <style>
        .check_list{
            margin-top: 5px;
        }
    </style>
</head>
<body>

<article class="page-container">
    <form action="{:url('action_data')}" method="post" class="form form-horizontal" id="check-form">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="hidden" id="id" name="id" value="{$data.id|default=''}">
                <input type="text" class="input-text" autocomplete="off" value="{$data.name|default=''}" placeholder="请输入名称"  id="name" name="name">
                <span class="c-red">规则名称,用中文描述一下</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">地址：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" autocomplete="off" value="{$data.url|default=''}" placeholder="请输入地址"  id="url" name="url">
                <span class="c-red">url访问路径，如:admin/index/index</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>归属上级：</label>
            <div class="formControls col-xs-8 col-sm-9">
                 <select name="pid" id="pid" class="input-text">
                    <option value="">顶级</option>
                    {volist name="auth_rules" id="vo"}
                    <option {eq name="data.pid" value="$vo.id"}selected{/eq} value="{$vo.id}">
                        {eq name="vo.pid" value="0"}
                            < {$vo.name} >
                        {else/}
                            {$vo.html} {$vo.name}
                        {/eq}
                    </option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">图标：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" autocomplete="off" value="{$data.icon|default=''}" placeholder="请输入图标"  id="icon" name="icon">
                <span class="c-red">图标地址:<a href="https://www.h-ui.net/Hui-3.7-Hui-iconfont.shtml" target="_blank">查看</a></span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>排序：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" autocomplete="off" value="{$data.sort|default='10'}" placeholder="请输入	排序"  id="sort" name="sort">
                <span class="c-red">排序值越小越靠前</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>菜单：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="radio-box">
                    <input name="menu" type="radio" value="1" id="menu-1" {:isset($data.menu)&&$data.menu=='1' || !isset($data.menu)?'checked':''}>
                    <label for="menu-1">是</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="menu-2" value="0" name="menu" {:isset($data.menu)&&$data.menu=='0'?'checked':''}>
                    <label for="menu-2">否</label>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>状态：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="radio-box">
                    <input name="status" type="radio" value="1" id="status-1" {:isset($data.status)&&$data.status=='1' || !isset($data.status)?'checked':''}>
                    <label for="status-1">启用</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="status-2" value="0" name="status" {:isset($data.status)&&$data.status=='0'?'checked':''}>
                    <label for="status-2">禁用</label>
                </div>
            </div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea id="remark" name="remark" cols="" rows="" autocomplete="off"  class="textarea"  placeholder="输入备注说明" >{$data.remark|default=''}</textarea>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <a class="btn btn-primary radius" type="submit" onclick="form_submit(['name'], false, false, submitCallBack)">&nbsp;&nbsp;提交&nbsp;&nbsp;</a>
                {if empty($Request.param.from)}
                <a class="btn btn-default radius" style="margin-left: 10px" target="_parent" href="{:url('index')}">&nbsp;&nbsp;返回&nbsp;&nbsp;</a>
                {/if}

            </div>
        </div>
    </form>
</article>
{include file="public/footer"}
<script src="/static/lib/jquery.form/jq.form.js"></script>
<script>
    function submitCallBack(res) {
        if ($('#id').val() === '' && res.code === 0) {
            $('#name').val('')
            $('#pid').val('')
            $('#url').val('')
            $('#icon').val('')
            $('#status-1').prop("checked", true);
            $('#status-2').prop("checked", false);
            $('#remark').val('')
        }
    }
</script>
</body>
</html>
